// components/playlist-data/playlist-data.js
const App = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tracks:{
      type:Array,
      value:[]
    }
  },
  options:{
    "styleIsolation":"apply-shared"
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    //音乐播放
    playMusic(event) {
      const {id,index} = event.currentTarget.dataset
      App.globalData.playList = this.data.tracks
      App.globalData.musicId = id
      App.globalData.index = index
      wx.navigateTo({url: '/pages/music-play/music-play?id=' + id})
    }
  }
})
